<template>
  <div class="layout">
    <header class="header">
      <top></top>
    </header>
    <div class="container">
      <router-view />
    </div>
  </div>
</template>

<script>
import top from "@/components/Header";
export default {
  name: "layout",
  components: {
    top
  },
  data() {
    return {
      windowHeight: "",
      windowWidth: ""
    };
  },
  created() {
    this.windowWidth = window.innerWidth;
    this.windowHeight = window.innerHeight;
  },
  watch: {
    windowHeight() {
      const layout = document.getElementsByClassName("layout")[0];
      layout.style.height = window.innerHeight + "px";
      layout.style.width = window.innerWidth + "px";
    }
  }
};
</script>

<style lang="scss" scoped>
.layout {
  height: 1080px;
  width: 100%;
  .header {
    width: 100%;
    height: 48px;
  }
  .container {
    width: 100%;
    height: calc(100% - 48px);
    background-color: #e4e4e4;
  }
}
</style>
